#pragma once
#include "AnimalFactory.h"
#include "Wolf.h"
#include "ReflexDeflex.h"
#include "Map.h"
class WolfFactory :
	public AnimalFactory
{
public:
	WolfFactory();
	~WolfFactory();

	static Animal* getWolf() {
		Map* cMap = Map::getInstanceCMap();
		XY* xy = new XY(rand() % MAPX, rand() % MAPY);
		while (cMap->getLocationMap(xy) != nullptr)
			xy = new XY(rand() % MAPX, rand() % MAPY);
		Animal* animal = new Wolf();
		animal->addPrey('R');
		animal->addPrey('S');
		animal->setName('W');
		animal->setAge(0);
		animal->setLifeTime(30);
		animal->setHunger(10);
		animal->setLocation(xy);
		animal->setReproduceFlag(true);
		if (rand() % 2 == 0)
			animal->setSex(true);
		else animal->setSex(false);

		cMap->setLocationMap(animal, xy);
		return animal;
	}
	static void createWolf() {
		AnimalFactory* animalFactory = AnimalFactory::getAnimalFactory();
		animalFactory->resiger("Wolf", WolfFactory::getWolf);
	};
};

